public class Main{
    public static void main(String[] args) {
        // 通过无参构造创建手机对象一
        Phone p1 = new Phone();
        p1.setBrand("小米");
        p1.type = "note11";
        p1.os = "Android";
        p1.price = 1888;
        p1.setMemorySize(16);
        // 测试p1的各项功能
        System.out.println(p1);
        p1.call(3);
        p1.playGame();
        p1.playMusic("我的中国心");
        System.out.println("********************");
        Phone p2 = new Phone("华为","华为荣耀20","Android",6666,16);
        // 测试p2 的各项功能
        p2.about();
        p2.call(4);
        p2.playGame();
        p2.playMusic("北京欢迎你");
    }
}
/*请在这一行之后作答*/
class  Phone{
    String brand;
    String type;
    int price;
    String os;
    int memorySize;
    public Phone(){}
    public Phone(String brand, String type, String os, int price, int memorySize) {
        this.brand = brand;
        this.type = type;
        this.price = price;
        this.os = os;
        this.memorySize = memorySize;
    }

    @Override
    public String toString() {
        return "Phone [" +
                "brand=" + brand  +
                ", type=" + type  +
                ", os=" + os +
                ", price=" + price +

                ", memorySize=" + memorySize +
                ']';
    }

    public void about(){
        System.out.println("品牌："+this.getBrand());
        System.out.println("型号："+this.getType());
        System.out.println("操作系统："+this.getOs());
        System.out.println("价格："+this.getPrice());
        System.out.println("内存："+this.getMemorySize());
    }
    public void call(int i){
        System.out.println("使用自动拨号功能：");
        if(i==3)
            System.out.println("爷爷的号。");
        else
            System.out.println("奶奶的号。");
    }
    public void playGame(){
        System.out.println("玩扫雷游戏。");
    }
    public void downloadMusic(){}

    public void playMusic(String s){
        System.out.println("播放歌曲："+s);
    }

    public String getBrand() {
        return brand;
    }

    public String getType() {
        return type;
    }

    public int getPrice() {
        return price;
    }

    public String getOs() {
        return os;
    }

    public int getMemorySize() {
        return memorySize;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public void setMemorySize(int memorySize) {
        this.memorySize = memorySize;
    }
}
